<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        html,body {
            height: 100%;
        }
    </style>
</head>
<body>
    <div style="background: green;height: 100%;">

        <div style="overflow: auto;">
            <div style="height: 1000px;background: gray;width: 200px;"></div>
        </div>
    </div>
</body>
</html>

<script>
window.onscroll = function() {
    console.log(2222);
}

</script>